#include"../result.hpp"
#include"../config.hpp"
#include"../drawer/drawer.hpp"
#include"../drawer/screen.hpp"
#include"../handler/handler.hpp"
#include"../object/world.hpp"
#include"../object/cube.hpp"
#include"../object/round.hpp"


#include<iostream>
#include <mutex>


extern "C" {

// Opaque struct pointers to represent C++ objects
typedef struct Screen_t* ScreenHandle;
typedef struct Camera_t* CameraHandle;
typedef struct ColorWorld_t* ColorWorldHandle;
typedef struct ColorCube_t* ColorCubeHandle;
typedef struct ColorRound_t* ColorRoundHandle;

// C wrapper functions
ScreenHandle createScreen(int width, int height);
void destroyScreen(ScreenHandle screen);

CameraHandle createCamera();
void destroyCamera(CameraHandle camera);

ColorWorldHandle createWorld(CameraHandle camera);
void destroyWorld(ColorWorldHandle world);

ColorCubeHandle createCube(int x, int y, int z, int size);
void destroyCube(ColorCubeHandle cube);

ColorRoundHandle createRound(int x, int y, int z, float radius);
void destroyRound(ColorRoundHandle round);

// Add cube/round to world
void addCubeToWorld(ColorWorldHandle world, ColorCubeHandle cube);
void addRoundToWorld(ColorWorldHandle world, ColorRoundHandle round);

// Main function to start rendering
void startRendering(ScreenHandle screen, ColorWorldHandle world);

}
